﻿/**
 * 
 * @file MaterialHyperelasticWidget.h
 * @brief 材料超弹性界面
 * @author BaGuijun (baguijun@163.com)
 * @date 2024-06-20
 * 
 */

#ifndef MaterialHyperelasticWidget_H
#define MaterialHyperelasticWidget_H

#include "MaterialWidgetBase.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialHyperElastic.h"
#include "FITK_Interface/FITKInterfaceStructural/FITKAbaMaterialBehavior.h"

namespace Ui {
    class MaterialHyperelasticWidget;
}

namespace GUI
{
    /**
     * @brief 材料超弹性界面
     * @author BaGuijun (baguijun@163.com)
     * @date 2024-06-20
     */
    class MaterialHyperelasticWidget :public MaterialWidgetBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief Construct a new Material Hyperelastic Widget object
         * @param[i]  item           材料对象
         * @param[i]  parent         父窗口对象
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        MaterialHyperelasticWidget(EventOper::ParaWidgetInterfaceOperator * oper,Interface::FITKAbaMaterialHyperElastic* item, QWidget* parent);
        /**
         * @brief Destroy the Material Hyperelastic Widget object
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        ~MaterialHyperelasticWidget();
        /**
         * @brief 数据检查
         * @return true 成功
         * @return false 失败
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-05-30
         */
        virtual bool checkValue() override;
        /**
         * @brief 数据存储(在调用该函数之前必须调用checkValue)
         * @return true 成功
         * @return false 失败
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-05-30
         */
        virtual bool saveValue() override;
    private slots:
        ;
        /**
         * @brief 材料选择温度按钮点击事件
         * @param[i]  checked        是否点击
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void on_checkBox_Temp_clicked(bool checked);
    private:
        /**
         * @brief 初始化ui
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void initUi();
        /**
         * @brief 各项同性数据存储
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void saveValueIso();
        /**
         * @brief 各项同性数据测试数据存储
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void saveValueIsoTestData();
        /**
         * @brief 各项异性系数数据存储
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void saveValueIsoCoefficients();
        /**
         * @brief 各项同性数据存储
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void saveValueAni();
        /**
         * @brief 显示数据
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void showValue();
        /**
         * @brief 显示各项同性参数
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void showValueIso();
        /**
         * @brief 各项同性系数数据显示
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void showValueIsoCoefficients();
        /**
         * @brief 显示各项同性中QTableWidget界面数据
         * @param[i]  type           类型
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void showIsoTableValue(Interface::FITKAbaMaterialBehaviorEnum::HyperelasticIsotropicStrainEnergyPotential type);
        /**
         * @brief 修改材料温度
         * @param[i]  type           类型
         * @param[i]  isTemp         是否使用温度
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        void changeMaterialTemp(Interface::FITKAbaMaterialBehaviorEnum::HyperelasticIsotropicStrainEnergyPotential type, bool isTemp);
    private:
        /**
         * @brief ui对象
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        Ui::MaterialHyperelasticWidget* _ui = nullptr;
        /**
         * @brief 材料对象
         * @author BaGuijun (baguijun@163.com)
         * @date 2024-06-20
         */
        Interface::FITKAbaMaterialHyperElastic* _materialItem = nullptr;
    };
}

#endif
